//
//  AccountTools.h
//  Yingzhi
//
//  Created by Maxwell Rose on 15/9/7.
//  Copyright (c) 2015年 yingzhi. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface AccountTools : NSObject
///**
// *  是否登录账号
// *
// *  @return 登录状态（YES or NO）
// */
//+ (BOOL)isLogined;

+(BOOL)isEmpty:(NSString *) string;

+ (BOOL)validatePhoneNumber:(NSString *)string;
+ (BOOL)validateEmail:(NSString *)string;

+ (BOOL)allIsNumber:(NSString *)string;
+ (BOOL)isIdentificationCard:(NSString *)idCardString;
+(BOOL)checkIDCard:(NSString *)value;



+ (BOOL)isConnectionAvailable;

+ (NSString *)md5:(NSString *)str;

/**
 *  存储账号密码
 *
 *  @param account  账号名称
 *  @param password 账号密码
 */
+ (void)saveOwnAccount:(NSString *)account andPassword:(NSString *)password;
/**
 *  获取存储的账号信息
 *
 *  @return @[account, password]
 */
+ (NSArray *)getOwnAccountAndPassword;

/**
 *  登录成功之后将token存入本地
 *
 *  @param token 登录标示
 */
+(void)saveUserToken:(NSString*)token;

/**
 *  从本地取出用户登录的token
 *
 *  @return 登录标示
 */
+(NSString*)getUserToken;


/**
 *  注销登录时,将token从本地删除
 */
+ (void)removeNSUserToken;

+(NSString *)getUserType;

+(void)saveUserCd:(NSString*)UserCd;//保存用户名

+(NSString*)getuserCd;

+ (void)removeNSuserCdn;

+(BOOL)isLogin;


+ (NSArray *)getExamInformation;

+(void)Savename:(NSString*)name
schoolName:(NSString *)schoolName
userHeadPhoto:(NSString *)userHeadPhoto
studentCode:(NSString *)studentCode
entryYear:(NSString *)entryYear
profession:(NSString *)profession
idNumber:(NSString *)idNumber
email:(NSString *)email userType:(NSString*)userType;

+ (NSArray *)getUserInformation;

+ (void)exitLogin;

+ (NSString *)stringFromValue:(NSObject *)value;

+ (BOOL)validatePassWord:(NSString*)PassWord;

+(BOOL)isUserName:(NSString *)name;
+ (BOOL)UnlimitedLengthfChineseCharacters:(NSString *)name;
@end
